TransactionDetail

Get Transaction Detail

This interface is used to get the details of the specified transaction. Currently, only five types of transaction queries are supported, including adding, modifying, deleting, truncating, and merging table data. The permissions of adding table, modifying table, truncating table, deleting table, and merging table data are still used.

Request address

GET/POST
http://OmsAddress/app/newoms.php/webservice/oamp/transaction/detail/<set_id>/<trans_id>?cmd=cmdVal&ip-type=webservicerest&access-token=AccessTokenVal

GET parameter description in url

Parameter name Data type Description Whether the field is required Remarks
set_id integer set id of the transaction Yes
trans_id integer transaction id Yes
cmd (cmdVal) integer Interface type. Get the table-adding transaction: cmd = 10002; get the table-modifying transaction: cmd = 10003; get the table-truncating transaction: cmd = 10004; get the table-deleting transaction: cmd = 10005; get the zone-deleting transaction: cmd = 10006; get the data-merging transaction: cmd = 10008; (table, process) data backup cmd: 10009; table data construction cmd: 10011; host data construction cmd: 10012 data import transaction cmd: 10013; index transaction cmd: 10022 Yes

POST request parameter description

Parameter name Data type Description Whether the field is required Remarks
get_action Integer (0, 1) Whether to return the action list of the transaction. 0: Do not return; 1: Return. No oms:3.38.1

Data Parameters

Use json format to represent the record related information. The following is an example:

{
    "get_action": 0
}

Return Syntax

Return Parameter Description

  1. When the returned status code is not 200, it indicates that the query was unsuccessful, and the returned data is error message

  2. When the returned status code is 200, it indicates that the transaction details are got successfully

Description of transaction fields

Field name Field type Field meaning
Id uint32 Transaction id
SetId uint32 set id of the transaction
AppId int32 app id, the app id of some types of transactions is meaningless and has no value
ZoneId int32 zone id, the zone id of some types of transactions is meaningless and has no value
Type uint32 transaction type
Status uint32 Status code. For the meaning of each status code, see the description of "transaction status list and status transformation that can be realized by using the web service interface" in this interface
CanRedo tinyint Whether it can be redone
CanSuspend tinyint Whether it can be suspended
CanRollback tinyint Whether it can be rolled back
Reason uint32 Status reason code
Num uint32 Number of resources involved
IdName string Table name, process ID, and node name
Data string Data information
Memo string Remarks
CreateUser string Transaction creator
CreateTime datetime Transaction creation time
UpdateTime datetime Transaction update time
ExtendInfo string For the expansion/shrinkage transaction, this field stores the ID of the CleanShardData transaction. For the CleanShardData transaction, this field stores the ID of expansion/shrinkage transaction, such as cmId = 72415; Other uses can be defined by yourself
MaxConcurrentCount uint32 Maximum number of parallel actions in a transaction. The maximum value is 10

Description of each field of the transaction's action

Field name Field type Field meaning
TransId uint32 Transaction id of the transaction to which action belongs
Id uint32 action id
AppId int32 app id
ZoneId int32 zone id
Type uint32 action type
Status uint32 Status code, meaning of each status code is as follows: Status = 1: Initializing Status = 2: Resource ready, to be executed Status = 3: Executing Status = 4: Suspending Status = 5: Rolling back Status = 6: Completed Status=7: End Status = 8: To be recovered Status = 9: Skip
Reason uint32 Status reason code
Num uint32 Number of resources involved
IdName string Table name will be saved in the case of table operation; process id will be saved in the case of process operation
Data string Data information
Context string Context information of the running action
CreateTime datetime Creation time
ExecuteTime datetime Execution time
UpdateTime datetime Update time

The transaction status list and the status transformation that can be realized by using the web service interface

Status a State a can be transformed into state b OMS interface used by state a => state b
To be executed (Status = 1) Waiting for execution; Failover Execute transactions (webservice can be called); Fail over transaction (webservice cannot be called)
Waiting for execution (Status = 2) None
Preparation before execution (Status = 3) None
Executing (Status = 4) Suspended Suspend transaction (webservice is not callable)
Suspending (Status=5) To be recovered; Fail over Recover transaction (webservice can be called); Fail over transaction
To be recovered (Status = 6) None
To be rolled back (Status = 7) None
Rolling back (Status = 8) Failover Fail over transaction
Successfully completed (Status = 9). This status is the end of the transaction. No further operations can be performed None
Failover (Status = 10). This status is the end of the transaction. No further operations can be performed None
Paused (Status = 1000)

Request Example

Send A Request through the Curl Method

For the parameters in the command, please refer to the "Description of POST Request Parameters" on this page. For the method to obtain access-token, see: Get access-token

curl -H "Content-type: application/json" -X "GET" -d '{
    "get_action": 0
}' http://omsaddress/app/newoms.php/webservice/oamp/transaction/detail/%3Cset_id%3E/%3Ctrans_id%3E?cmd=cmdVal&ip-type=webservicerest&access-token=\&set_id=\&trans_id=\

Return Example

Successful Return Example

Status of http request = 200

  1. An example of successfully getting the details of a table-adding transaction
{
    "Id": 300,
    "AppId": 2,
    "ZoneId": 5,
    "Type": 283,
    "Status": 9,
    "Reason": 0,
    "Num": 0,
    "IdName": "add_table350",
    "Data": "proxy@;tcapsvr@master#1",
    "Memo": "AddTableManual",
    "CreateUser": "tcaplus",
    "CreateTime": "2021-07-23 16:17:20",
    "UpdateTime": "2021-07-23 16:17:47",
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "SetId": 1,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10,
    "StatusText": "Successfully completed"
}
  1. An example of successfully getting the details of a table-modifying transaction
{
    "Id": 405,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 281,
    "Status": 10,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRol lback": 1,
    "Reason": 2,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "fc448894b1fc2e22ece9a6873b33c7b6",
    "Memo": "ModifyTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 21:38:30",
    "UpdateTime": "2017-03-02 21:41:37",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}
  1. An example of successfully getting the details of a table-truncating transaction
{
    "Id": 408,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 279,
    "Status": 9,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "Reason": 0,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "",
    "Memo": "TruncateTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 21:57:56",
    "UpdateTime": "2017-03-02 22:00:29",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}
  1. An example of successfully getting the details of a table-deleting transaction
{
    "Id": 411,
    "AppId": 2,
    "ZoneId": 3,
    "Type": 363,
    "Status": 9,
    "CanRedo": 1,
    "CanSuspend": 1,
    "CanRollback": 1,
    "Reason": 0,
    "Num": 0,
    "IdName": "test_table_generic_modify",
    "Data": "",
    "Memo": "DeleteTable",
    "CreateUser": "tcaplus",
    "CreateTime": "2017-03-02 22:12:49",
    "UpdateTime": "2017-03-02 22:17:38",
    "SetId": 126,
    "ExtendInfo": "",
    "MaxConcurrentCount": 10
}

Failed Return Example

Status of http request != 200

{
    "name": "Unauthorized",
    "message": "You are requesting with an invalid credential.",
    "code": 0,
    "status": 401,
    "type": "yii\\web UnauthorizedHttpException"
}
{
    "trans_id": [
        "for the cmd(cmd:10004),can only get those transaction of which type is in 279,type of transaction(id:411) is 363"
    ]
}

results matching ""

    No results matching ""